package orgs

import (
	"github.com/gin-gonic/gin"
	"gogs.xiaoyuanjijiehao.com/antlinker/antcms/app/ginsrv/oplog"
	"gogs.xiaoyuanjijiehao.com/antlinker/antcms/core"
)

// Init 初始化
func Init(route *gin.RouterGroup, d core.CmsDomain) {
	org := createCtrl(d)
	route.GET("", oplog.OplogRoute("cms_svc/orgs/getself", "获取当前用户组织信息", org.getOrg))
	route.POST("", oplog.OplogRoute("cms_svc/orgs/open", "开通当前用户展板", org.add))
	route.DELETE("", oplog.OplogRoute("cms_svc/orgs/delete", "关闭当前用户展板", org.delete))
	route.PUT("icon", oplog.OplogRoute("cms_svc/orgs/update/icon", "恢复删除组织图标", org.updateIcon))
	route.PUT("columns", oplog.OplogRoute("cms_svc/orgs/update/columns", "恢复删除组织", org.updateColumn))
	route.PUT("desc", oplog.OplogRoute("cms_svc/orgs/update/desc", "修改当前组织描述", org.updateDesc))
	route.PUT("publish", oplog.OplogRoute("cms_svc/orgs/publish", "发布当前组织展板", org.publish))
	route.PUT("nopublish", oplog.OplogRoute("cms_svc/orgs/nopublish", "取消发布当前组织展板", org.nopublish))
}
